﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using sgsBase;

namespace TestApp
{
    public partial class SiteMaster : SgsMasterPage
    {
		protected override void PagePreRender(object sender, EventArgs e)
        {
			if (titleText.Text == "")
				titleText.Text = ApplicationHelper.SiteTitle;

			if (Gl.Message != "")
			{
				sgsMessage.Text = Gl.Message;
				sgsMessage.Visible = true;
				Gl.Message = "";
			}
			else
			{
				sgsMsgDiv.Visible = false;
				//sgsMessage.Visible = false;
			}
        }

		//protected void onLoggingOut(object sender, System.Web.UI.WebControls.LoginCancelEventArgs e)
		//{
		//    //SgsGlobal sgl = (SgsGlobal)HttpContext.Current.ApplicationInstance;

		//    try
		//    {
		//        // it is possible to not have a Gl on the logout due to various issues within testing.
		//        Gl.CurUser.Logout();
		//    }
		//    catch { }
		//}

    }
}
